/*     */ package com.lmpop.trade.ti_warehouse;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_warehouseInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_warehouseInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Ti_warehouse ti_warehouse = new Ti_warehouse();
/*  25 */     ti_warehouse.setHouse_id(map.getString("house_id"));
/*  26 */     ti_warehouse.setCust_id(map.getString("cust_id"));
/*  27 */     ti_warehouse.setState_code(map.getString("state_code"));
/*  28 */     ti_warehouse.setTitle(map.getString("title"));
/*  29 */     ti_warehouse.setBiz_type(map.getString("biz_type"));
/*  30 */     ti_warehouse.setArea_attr(map.getString("area_attr"));
/*  31 */     ti_warehouse.setAddress(map.getString("address"));
/*  32 */     ti_warehouse.setArea(map.getInt("area"));
/*  33 */     ti_warehouse.setHouse_type(map.getString("house_type"));
/*  34 */     ti_warehouse.setPrice(map.getString("price"));
/*  35 */     ti_warehouse.setEnd_date(map.getString("end_date"));
/*  36 */     ti_warehouse.setIn_date(map.getString("in_date"));
/*  37 */     ti_warehouse.setUser_id(map.getString("user_id"));
/*  38 */     ti_warehouse.setRemark(map.getString("remark"));
/*     */ 
/*  40 */     String result_code = "0";
/*     */     try {
/*  42 */       insert(dbmMgr, ti_warehouse);
/*     */     } catch (ApplicationException e) {
/*  44 */       e.printStackTrace();
/*  45 */       result_code = "1";
/*     */     }
/*  47 */     map.setString("result_code", result_code);
/*  48 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_warehouse ti_warehouse)
/*     */     throws ApplicationException
/*     */   {
/*  57 */     dbmMgr.update("insertTi_warehouse", ti_warehouse);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  67 */     String pkid_string = map.getString("pkid");
/*  68 */     String result_code = "0";
/*     */     try {
/*  70 */       if (!pkid_string.equals("")) {
/*  71 */         String[] pkStr = pkid_string.split("\\|");
/*  72 */         for (int i = 0; i < pkStr.length; i++) {
/*  73 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  77 */       e.printStackTrace();
/*  78 */       result_code = "1";
/*     */     }
/*  80 */     map.setString("result_code", result_code);
/*  81 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  90 */     dbmMgr.update("deleteTi_warehouse", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  99 */     Ti_warehouse ti_warehouse = new Ti_warehouse();
/* 100 */     ti_warehouse.setHouse_id(map.getString("house_id"));
/* 101 */     ti_warehouse.setCust_id(map.getString("cust_id"));
/* 102 */     ti_warehouse.setState_code(map.getString("state_code"));
/* 103 */     ti_warehouse.setTitle(map.getString("title"));
/* 104 */     ti_warehouse.setBiz_type(map.getString("biz_type"));
/* 105 */     ti_warehouse.setArea_attr(map.getString("area_attr"));
/* 106 */     ti_warehouse.setAddress(map.getString("address"));
/* 107 */     ti_warehouse.setArea(map.getInt("area"));
/* 108 */     ti_warehouse.setHouse_type(map.getString("house_type"));
/* 109 */     ti_warehouse.setPrice(map.getString("price"));
/* 110 */     ti_warehouse.setEnd_date(map.getString("end_date"));
/* 111 */     ti_warehouse.setIn_date(map.getString("in_date"));
/* 112 */     ti_warehouse.setUser_id(map.getString("user_id"));
/* 113 */     ti_warehouse.setRemark(map.getString("remark"));
/*     */ 
/* 115 */     String result_code = "0";
/*     */     try {
/* 117 */       update(dbmMgr, ti_warehouse);
/*     */     } catch (ApplicationException e) {
/* 119 */       e.printStackTrace();
/* 120 */       result_code = "1";
/*     */     }
/* 122 */     map.setString("result_code", result_code);
/* 123 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_warehouse ti_warehouse)
/*     */     throws ApplicationException
/*     */   {
/* 132 */     dbmMgr.update("updateTi_warehouse", ti_warehouse);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 142 */     Map ti_warehouse = (Hashtable)obj;
/* 143 */     if (start == 0)
/* 144 */       start = 0;
/*     */     else {
/* 146 */       start = (start - 1) * limit;
/*     */     }
/* 148 */     ti_warehouse.put("start", Integer.valueOf(start));
/* 149 */     ti_warehouse.put("limit", Integer.valueOf(limit));
/* 150 */     return this.queryList.getList("getListByTi_warehousePage", ti_warehouse);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 161 */     Map ti_warehouse = (Hashtable)obj;
/* 162 */     List list = this.queryList.getList("getCountByObjTi_warehouse", obj);
/* 163 */     int count = 0;
/* 164 */     if ((list != null) && (list.size() > 0)) {
/* 165 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 166 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 167 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 170 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 180 */     return this.queryList.getList("getTi_warehouseByPk", pk);
/*     */   }
/*     */ 
/*     */   public SysMap updateState(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 190 */     Map state_code_map = new Hashtable();
/* 191 */     String pkid_string = map.getString("pkid");
/* 192 */     String state_code = map.getString("up_operating");
/* 193 */     state_code_map.put("state_code", state_code);
/* 194 */     String result_code = "0";
/*     */     try {
/* 196 */       if (!pkid_string.equals("")) {
/* 197 */         String[] pkStr = pkid_string.split("\\|");
/* 198 */         for (int i = 0; i < pkStr.length; i++)
/* 199 */           if (!pkStr[i].equals("")) {
/* 200 */             state_code_map.put("house_id", pkStr[i]);
/* 201 */             updateState(dbmMgr, state_code_map);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 207 */       e.printStackTrace();
/* 208 */       result_code = "1";
/*     */     }
/* 210 */     map.setString("result_code", result_code);
/* 211 */     return map;
/*     */   }
/*     */ 
/*     */   public void updateState(DbmInterf dbmMgr, Map state_code_map)
/*     */     throws ApplicationException
/*     */   {
/* 220 */     dbmMgr.update("updateTi_warehouse_state", state_code_map);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_warehouse.Ti_warehouseInfo
 * JD-Core Version:    0.6.0
 */